<?php

namespace app\common\validate\user;

use think\Validate;

class Enter extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'name' => 'require',
        'phone' => 'regex:1[3-9]\d{9}',
        'category_ids' => 'require',
        'content' => 'require',
        'images' => 'require',
        'profession' => 'require'
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'name.require' => '姓名不能为空',
        'phone.regex' => '手机格式错误',
        'category_ids.require' => '请选择服务类型',
        'content.require' => '申请理由不能为空',
        'images.require' => '请上传证件',
        'profession.require' => '经营行业不能为空',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'employee'  => ['name', 'phone', 'category_ids', 'content', 'images'],
        'salesman' => ['name', 'phone', 'content', 'images'],
        'partner' => ['name', 'phone', 'content', 'images', 'profession'],
    ];
}
